package ru.spb.osll.myfit.common;

import java.io.Serializable;

public class ProgressCounts implements Serializable{

  private static final long serialVersionUID = 5126125481689625242L;
  
  private int m_right;
  private int m_wrong;
  private int m_ignores;
  private int m_exceptions;
  private int m_progressSegments;
  private int m_totalSegments;
  
  public ProgressCounts () {
    m_right = 0;
    m_wrong = 0;
    m_ignores = 0;
    m_exceptions = 0;
    m_progressSegments = 0;
    m_totalSegments = 0;    
  }
  
  public ProgressCounts (int right, int wrong, int ignores, int exceptions, int progressSegments, int totalSegments) {
    m_right = right;
    m_wrong = wrong;
    m_ignores = ignores;
    m_exceptions = exceptions;
    m_progressSegments = progressSegments;
    m_totalSegments = totalSegments;    
  }
  
  public ProgressCounts (ProgressCounts counts) {
    m_right = counts.getRight();
    m_wrong = counts.getWrong();
    m_ignores = counts.getIgnores();
    m_exceptions = counts.getExceptions();
    m_progressSegments = counts.getProgressSegments();
    m_totalSegments = counts.getTotalSegments();    
  }
  
  public void setCounts (int right, int wrong, int ignores, int exceptions, int progressSegments, int totalSegments) {
    m_right = right;
    m_wrong = wrong;
    m_ignores = ignores;
    m_exceptions = exceptions;
    m_progressSegments = progressSegments;
    m_totalSegments = totalSegments;    
  }
  
  public void setCounts (ProgressCounts counts) {
    m_right = counts.getRight();
    m_wrong = counts.getWrong();
    m_ignores = counts.getIgnores();
    m_exceptions = counts.getExceptions();
    m_progressSegments = counts.getProgressSegments();
    m_totalSegments = counts.getTotalSegments();    
  }
  
  public void setCounts (int right, int wrong, int ignores, int exceptions) {
    m_right = right;
    m_wrong = wrong;
    m_ignores = ignores;
    m_exceptions = exceptions;   
  }
  
  public void setCounts (int progressSegments, int totalSegments) {
    m_progressSegments = progressSegments;
    m_totalSegments = totalSegments;   
  }
  
  public void setProgressSegments (int progressSegments) {
    m_progressSegments = progressSegments;  
  }
  
  public void setTotalSegments (int totalSegments) {
    m_totalSegments = totalSegments;   
  }
  
  public ProgressCounts getCounts() {
    ProgressCounts newCounts = new ProgressCounts(this);
    return newCounts;    
  }
  
  public boolean isNull() {
    boolean isNull;
    isNull = (m_right == 0) && (m_wrong == 0) && (m_ignores == 0) && (m_exceptions == 0) && 
             (m_progressSegments == 0) && (m_totalSegments == 0);
    return isNull;
    
  } 
      
  public int getRight() {
    return m_right;    
  }
  
  public int getWrong() {
    return m_wrong;    
  }
  
  public int getIgnores() {
    return m_ignores;    
  }
  
  public int getExceptions() {
    return m_exceptions;    
  }
  
  public int getProgressSegments() {
    return m_progressSegments;    
  }
  
  public int getTotalSegments() {
    return m_totalSegments;    
  }  
}